<template>
  <div> 
      <div class="title">
        <h4>{{title}}</h4>
        <span class="btn" @click="isShow =!isShow">
          {{isShow ? '收起':'展开'}}
        </span>
      </div>
      <div class="container" v-show="isShow">
        <p v-for="(item,idx) in content" :key="idx">{{item}}</p>
       
      </div>
    </div>

</template>
<script>
export default {
  props:['title','content'],
   data() {
    return {
      isShow:true
    }
  },
}
</script>
<style scoped>
.title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #ccc;
    padding: 0 1em;
  }
  .title h4 {
    line-height: 2;
    margin: 0;
  }
  .container {
    border: 1px solid #ccc;
    padding: 0 1em;
  }
  .btn {
    /* 鼠标改成手的形状 */
    cursor: pointer;
  }
</style>